import { defineStore } from 'pinia'

export const useIndicatorStore = defineStore(({
    id:'indicator',
    state: () => ({
        indicatorList: [
            {
                id:1,
                name:'健康舒适',
                description:'健康舒适,为市民提供健康、舒适的生活环境'
            },
            {
                id:2,
                name:'交通便捷',
                description:'交通便捷,为市民提供便捷的交通出行'
            },
            {
                id:3,
                name:'环境宜居',
                description:'环境宜居,为市民提供宜居的生活环境'
            },
            {
                id:4,   
                name:'社会和谐',
                description:'社会和谐,为市民提供和谐的社会环境'
            },
            {
                id:5,
                name:'文化繁荣',            
                description:'文化繁荣,为市民提供丰富的文化生活'
            },
            {
                id:6,
                name:'管理有序',
                description:'管理有序,为市民提供有序的管理环境'
            }
        ],
    }),
    getters: {
        getIndicatorList: (state) => state.indicatorList
    },
    actions: {
        CHANGE_PROPERTY({ key, value }: { key: any, value: any }) {
            if (Reflect.has(this, key)) {
              this[key] = value as any;
            }
          },
        change(data:any) {
         this.CHANGE_PROPERTY(data);
        },
    }
}))

